possible issue in mod_perl 2.0.4 with respect to STDERR

possible issue in mod_perl 2.0.4 with respect to STDERR

am 12.11.2009 13:01:09 von Shibi NS

--001636e1f93d82dc2b04782b4c82
Content-Type: text/plain; charset=ISO-8859-1

Configuration error log is in my applications httpd config file is


ErrorLog = "'| rotatelogs \log\error_log 1M "'

But if print something on STDERR from mod_perl program , Say debug print
(print STDERR "DEBUG ";) this is going to \log\error_log instead of
\log\error_log.NNN

Is this is a mod perl issue or i am doing something wrong

--Shibi Ns--

--001636e1f93d82dc2b04782b4c82
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


Configuration error log is in my applications httpd confi=
g file is


ErrorLog =3D "'| rotatelogs \log\error_log 1M=
"'

But if print something on STDERR from mod_perl program =
, Say debug print (print STDERR "DEBUG ";) this is going to \log\=
error_log instead of=A0 \log\error_log.NNN


Is this is a mod perl issue or i am doing something wrong

--Shi=
bi Ns--


--001636e1f93d82dc2b04782b4c82--

Re: possible issue in mod_perl 2.0.4 with respect to STDERR

am 12.11.2009 13:50:17 von torsten.foertsch

On Thu 12 Nov 2009, Shibi NS wrote:
> Configuration error log is in my applications httpd config file is
>
>
> ErrorLog = "'| rotatelogs \log\error_log 1M "'
>
> But if print something on STDERR from mod_perl program , Say debug
> print (print STDERR "DEBUG ";) this is going to \log\error_log
> instead of \log\error_log.NNN
>
> Is this is a mod perl issue or i am doing something wrong

I suspect this ErrorLog directive resides inside a VHost?

STDERR is bound to the programs notion of file descriptor 2 or whatever
it is on windows, not to the ErrorLog.

If you want to write to a VHost's ErrorLog use $r->log &co.

See also

http://www.gossamer-threads.com/lists/modperl/modperl/99241
http://www.gossamer-threads.com/lists/modperl/modperl/99219
http://www.gossamer-threads.com/lists/modperl/modperl/99504

In addition to what is said here
http://www.gossamer-threads.com/lists/modperl/modperl/99248# 99248
another way to capture STDERR could be a PERLIO layer or to tie STDERR
to something.

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

Re: possible issue in mod_perl 2.0.4 with respect to STDERR

am 12.11.2009 14:36:27 von Shibi NS

--001636e1f85d59b4fc04782ca12c
Content-Type: text/plain; charset=ISO-8859-1

No its not VHOST

The configuration in httpd look like this


my $app_home = $ENV{APPS_HOME};
my $config = ConfigLoader::include("$app_home/conf/
ursforms.pl");

my $clog = '"| rotatelogs '. $config->{log_accessfile} .
'%y%m%d 1M " common';
my $elog = '"| rotatelogs '. $config->{log_file} . '%y%m%d
1M "';

$ServerAdmin = $config->{contact};
$ServerRoot = $app_home;
$DocumentRoot = $app_home . "/webdocs";
$ErrorLog = $elog ;
$CustomLog = $clog;
$PidFile = $config->{log_pidfile};
$LockFile = $config->{log_lockfile};
$ScoreBoardFile = $config->{log_statusfile};

Where the $config->{log_file} is
/nfs/private/user/sns/log/ursforms.myserver-44088.log

% ps -ef | grep ursforms | grep sns
sns 23265 1 0 04:21 ? 00:00:03 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns 23278 23265 0 04:21 ? 00:00:00 rotatelogs
/m/isd/log/ursforms.ap6415isd-44088.log%y%m%d 1M
sns 23279 23265 0 04:21 ? 00:00:00 rotatelogs
/m/isd/log/ursforms.ap6415isd-44088.access%y%m%d 1M
sns 23280 23265 0 04:21 ? 00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns 23281 23265 0 04:21 ? 00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns 23333 23265 0 04:21 ? 00:00:00 httpd -f
/m/isd/conf/ursforms.conf -D SYSTEST -D DEV
sns 27002 20796 0 05:07 pts/67 00:00:00 grep ursforms

Parent process info

% ls -lrt fd/
total 0
lr-x------ 1 sns g680 64 Nov 12 05:08 9 ->
pipe:[2129198375]
l-wx------ 1 sns g680 64 Nov 12 05:08 8 ->
pipe:[2129198353]
lr-x------ 1 sns g680 64 Nov 12 05:08 7 ->
/m/isd/conf/apps-forms.d/
lr-x------ 1 sns g680 64 Nov 12 05:08 6 ->
pipe:[2129198353]
lrwx------ 1 sns g680 64 Nov 12 05:08 3 ->
socket:[2129164640]
l-wx------ 1 sns g680 64 Nov 12 05:08 2 ->
pipe:[2129198354]
l-wx------ 1 sns g680 64 Nov 12 05:08 10 ->
pipe:[2129198375]
l-wx------ 1 sns g680 64 Nov 12 05:08 1 -> /dev/null
lr-x------ 1 sns g680 64 Nov 12 05:08 0 -> /dev/null

PWD /proc/23265

one of the child process info.

% ls -lrt ../23279/fd
total 0
l-wx------ 1 sns g680 64 Nov 12 05:09 3 ->
/nfs/private/user/sns/log/ursforms.myserver-44088.access0911 12
l-wx------ 1 sns g680 64 Nov 12 05:09 2 ->
pipe:[2129198354]
l-wx------ 1 sns g680 64 Nov 12 05:09 1 -> /dev/null
lr-x------ 1 sns g680 64 Nov 12 05:09 0 ->
pipe:[2129198375]

Now what i don't under stand is when print STDERR why its printing to
/nfs/private/user/sns/log/ursforms.myserver-44088.log how does it know this
file ?

Shibi Ns

On Thu, Nov 12, 2009 at 6:20 PM, Torsten Foertsch
wrote:

> On Thu 12 Nov 2009, Shibi NS wrote:
> > Configuration error log is in my applications httpd config file is
> >
> >
> > ErrorLog = "'| rotatelogs \log\error_log 1M "'
> >
> > But if print something on STDERR from mod_perl program , Say debug
> > print (print STDERR "DEBUG ";) this is going to \log\error_log
> > instead of \log\error_log.NNN
> >
> > Is this is a mod perl issue or i am doing something wrong
>
> I suspect this ErrorLog directive resides inside a VHost?
>
> STDERR is bound to the programs notion of file descriptor 2 or whatever
> it is on windows, not to the ErrorLog.
>
> If you want to write to a VHost's ErrorLog use $r->log &co.
>
> See also
>
> http://www.gossamer-threads.com/lists/modperl/modperl/99241
> http://www.gossamer-threads.com/lists/modperl/modperl/99219
> http://www.gossamer-threads.com/lists/modperl/modperl/99504
>
> In addition to what is said here
> http://www.gossamer-threads.com/lists/modperl/modperl/99248# 99248
> another way to capture STDERR could be a PERLIO layer or to tie STDERR
> to something.
>
> Torsten
>
> --
> Need professional mod_perl support?
> Just hire me: torsten.foertsch@gmx.net
>



--
--Shibi Ns--

--001636e1f85d59b4fc04782ca12c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

No its not VHOST



The configuration in httpd look like this



<Perl>

  =A0 my $app_home     =3D $ENV{APPS_HOME};

  =A0 my $config          =A0 =3D ConfigLoader::inc=
lude("$app_home/conf/&qu=
ot;);  =A0

  

  =A0 my $clog               =3D '"=
;| rotatelogs '. $config->{log_accessfile} . '%y%m%d 1M " c=
ommon';

  =A0 my $elog =A0 =A0 =A0 =A0 =A0   =A0 =3D '"| rotatelog=
s '. $config->{log_file} . '%y%m%d 1M "';



=A0 =A0 $ServerAdmin    =A0 =3D $config->{contact};

  =A0 $ServerRoot         =3D $app_home;

  =A0 $DocumentRoot   =3D $app_home . "/webdocs";

  =A0 $ErrorLog            =3D $elog ;

  =A0 $CustomLog      =A0 =3D $clog;

  =A0 $PidFile            =A0 =3D $config->{=
log_pidfile};

  =A0 $LockFile          =A0 =3D $config->{log_l=
ockfile};

  =A0 $ScoreBoardFile=A0 =3D $config->{log_statusfile};

</Perl>

Where the $config->{log_file}=A0 is /nfs/private/user/sns/log/ursforms.=
myserver-44088.log



% ps -ef | grep ursforms | grep sns

sns    =A0 23265     1=A0 0 04:21 ?      =A0 00=
:00:03 httpd -f /m/isd/conf/ursforms.conf -D SYSTEST -D DEV

sns    =A0 23278 23265=A0 0 04:21 ?      =A0 00:00:00 r=
otatelogs /m/isd/log/ursforms.ap6415isd-44088.log%y%m%d 1M

sns    =A0 23279 23265=A0 0 04:21 ?      =A0 00:00:00 r=
otatelogs /m/isd/log/ursforms.ap6415isd-44088.access%y%m%d 1M

sns    =A0 23280 23265=A0 0 04:21 ?      =A0 00:00:00 h=
ttpd -f /m/isd/conf/ursforms.conf -D SYSTEST -D DEV

sns    =A0 23281 23265=A0 0 04:21 ?      =A0 00:00:00 h=
ttpd -f /m/isd/conf/ursforms.conf -D SYSTEST -D DEV

sns    =A0 23333 23265=A0 0 04:21 ?      =A0 00:00:00 h=
ttpd -f /m/isd/conf/ursforms.conf -D SYSTEST -D DEV

sns    =A0 27002 20796=A0 0 05:07 pts/67   00:00:00 grep ursfor=
ms



Parent process info


% ls -lrt fd/

total 0

lr-x------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 9 -> pipe:[2129198375]

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 8 -> pipe:[2129198353]

lr-x------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 7 -> /m/isd/conf/apps-forms.d/

lr-x------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 6 -> pipe:[2129198353]

lrwx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 3 -> socket:[2129164640]

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 2 -> pipe:[2129198354]

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 10 -> pipe:[2129198375]

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 1 -> /dev/null

lr-x------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:08 0 -> /dev/null



PWD /proc/23265              



one of the child process info.



% ls -lrt=A0 ../23279/fd

total 0

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:09 3 -> /nfs/private/user/sns/log/ursforms.myserver-44088.=
access091112

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:09 2 -> pipe:[2129198354]

l-wx------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:09 1 -> /dev/null

lr-x------  =A0 1 sns    =A0 g680          =
64 Nov 12 05:09 0 -> pipe:[2129198375]



Now what i don't under stand is when print STDERR why its printing to =
/nfs/private/user/sns/log/ursforms.myserver-44088.log how does it know this=
file ?



Shibi Ns

On Thu, Nov 12, 2009 at 6:20 PM,=
Torsten Foertsch < gmx.net">torsten.foertsch@gmx.net> wrote:
s=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margi=
n: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu 12 Nov 2009, Shibi NS wrote:

> Configuration error log is in my applications httpd config file is

>

>

> ErrorLog =3D "'| rotatelogs \log\error_log 1M "'

>

> But if print something on STDERR from mod_perl program , Say debug

> print (print STDERR "DEBUG ";) this is going to \log\error_l=
og

> instead of \log\error_log.NNN

>

> Is this is a mod perl issue or i am doing something wrong



I suspect this ErrorLog directive resides inside a VHost?



STDERR is bound to the programs notion of file descriptor 2 or whatever

it is on windows, not to the ErrorLog.



If you want to write to a VHost's ErrorLog use $r->log &co.



See also



get=3D"_blank">http://www.gossamer-threads.com/lists/modperl /modperl/99241<=
/a>

get=3D"_blank">http://www.gossamer-threads.com/lists/modperl /modperl/99219<=
/a>

get=3D"_blank">http://www.gossamer-threads.com/lists/modperl /modperl/99504<=
/a>



In addition to what is said here

8" target=3D"_blank">http://www.gossamer-threads.com/lists/modp erl/modperl/=
99248#99248


another way to capture STDERR could be a PERLIO layer or to tie STDERR

to something.



Torsten



--

Need professional mod_perl support?

Just hire me: torsten.foertsch@=
gmx.net





--
--Shibi Ns--


--001636e1f85d59b4fc04782ca12c--